<template>
  <div>
    <div class="container">
      <van-popup  v-model="show" position="bottom" show-cancel-button
                  style="position:fixed;top: 100px;height: 400px;overflow: hidden;width: 300px;background:rgba(255,255,255,0);" align="center">
        <!--<a :href="alertRespon.url" style="background:rgba(255,255,255,0)">-->
        <div class="prizeBox" v-show="choujiangImg">
          <img :src="this.ifOpenPrize.image" alt="" @click="choujiang">
        </div>
        <div class="prizeBox" v-show="jieguoImg" @click="lingjiang">
          <img :src="this.chouPrize.image" alt="">
        </div>
        <!--</a>-->
       <!-- <p style="width: 25px;">
          <img src="../../assets/twelve/X.png" alt=""  @click="close">
        </p>-->
      </van-popup>
    </div>
  </div>
</template>

<script>
  import request from '../../request/index'
    export default {
        name: "getPrize",
      data(){
          return{
            choujiangImg:true,
            show:0,
            chouPrize:[],
            alertRespon:[],
            ifOpenPrize:[],
            lingPrize:[],
            gift_id:'',
            jieguoImg:false,
          }
      },
      methods:{
        choujiang(){
          if (this.show == 0){
            this.$toast("您当前没有抽奖机会，快去下单得抽奖机会吧！");
            this.show == 0;
          }else{
            request.chouPrize(this);
            this.choujiangImg = !this.choujiangImg;
            this.jieguoImg = !this.jieguoImg;
            request.ifOpenPrize(this);
          }
        },
        lingjiang(){
          if (this.gift_id == 0){
            this.choujiangImg = !this.choujiangImg;
            this.jieguoImg = !this.jieguoImg;
          }else{
            request.lingPrize(this);
            this.choujiangImg = !this.choujiangImg;
            this.jieguoImg = !this.jieguoImg;
          }
        },
        close(){
          this.show = !this.show;
        },
      },
      mounted(){

      },
      created(){
          request.ifOpenPrize(this);
      }
    }
</script>

<style scoped lang="scss">
.container{
  width: 100vw;
  height: 120vh;
 /* background-image: url("../../assets/twelve/bg135.png");
  background-size: 100%;*/
  background: #f5f5f5;
  .prizeBox{
    border-radius: 2vw;
    overflow: hidden;
  }
}
</style>
